package com.kelvem.saas.workbanch.core.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 错误编码
 *
 * @author kelvem
 */
@AllArgsConstructor
@Getter
public enum ErrorCodeEnum {

    // 5xx
    COMMON_PARAM_NULL("10001", "方法参数为null"),
    COMMON_PARAM_EMPTY("10002", "方法参数为空"),
    COMMON_OBJECT_NULL("10101", "空对象"),

    // 5xx
    LOGIN_FAIL("20001", "用户名或密码错误"),

    // 4xx
    UNAUTHORIZED("30101", "未授权"),
    ACCESS_DENIED("30201", "访问被拒绝"),
    JWT_NOTOKEN("31002", "JWT 无令牌"),
    JWT_NOUSER("31003", "JWT 无用户"),
    JWT_EXPIRED("31004", "JWT 已过期"),    // ExpiredJwtException JWT token is expired
    JWT_MALFORMED("31005", "JWT 格式错误"),
    JWT_INVALID("31006", "JWT 无效"),
    JWT_SIGN_ERR("31007", "JWT 签名错误"),

    // 5xx
    SYS_EXCEPTION("90000", "系统异常"),
    FAILT("1", "失败"),

    // 200
    OK("0", "成功");

    private String code;
    private String message;
}
